package io;

import java.io.*;

public class OISDemo {//反序列化,把序列化后的对象还原回去
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        FileInputStream fis =new FileInputStream("student.obj");
        ObjectInputStream ois =new ObjectInputStream(fis);
        Object obj = ois.readObject();//用obj接收
        Student zs =(Student)obj;//再强转转回Student,赋值给张三
        System.out.println(zs);
        ois.close();
    }
}
